#include <stdio.h>

// int max(int c, int d);
// void maxx(int arr[3]);
int max(int c, int d){
    c = c+1;
    d = d+1;
    int e = c>d?c:d;
    return e;
}

int maxx(int arr[3]){
    arr[0] = 3;
    // arr = {4,5,6};
    return arr[0];
}
/*
关于调用函数时形参和实参的传递
*/
int main()
{
    int a =1,b=2;
    printf("a=%d,b=%d\n", a, b);
    int e = max(a,b);
    printf("a=%d,b=%d\n", a, b);

    int array [3] = {9,8,7};
    printf("arr[0]=%d\n", array[0]);
    int f = maxx(array);
    printf("arr[0]=%d\n", array[0]);

    //单独修改数组元素的值可行，
    //将数组作为参数传递到函数中，在函数中修改数组元素的值也可行。
    //一般通过遍历数组来赋值
    int arr2[3] = {1,3,5};
    printf("before:arr2[1]=%d\n", arr2[1]);
    arr2[1] = 4;
    printf("after:arr2[1]=%d", arr2[1]);
    return 0;
}

